package com.tul.exercise.base.operator.egs;


import org.junit.jupiter.api.Test;

import static com.tul.exercise.base.utils.Print.print;

/**
 * @Description 《java编程思想》第3章 示例9：
 * <p>
 * 位移运行符
 **/
public class eg_09_URShift {
    @Test
    public void test(){
        int i = -1;
        print("i: " + Integer.toBinaryString(i));
         i >>>= 10;
        print("i >>>= 10 :" +Integer.toBinaryString(i));

        long l = -1;
        print("l: " + Long.toBinaryString(l));
        l >>>= 10;
        print("l >>>= 10 :" + Long.toBinaryString(l));

        short s = -1;
        print("s: " + Integer.toBinaryString(s));
        s >>>= 10;
        print("s >>>= 10 :" + Integer.toBinaryString(s));

        byte b = -1;
        print("b: " + Integer.toBinaryString(b));
        b >>>= 10;
        print("b >>>= 10 :" + Integer.toBinaryString(b));

        print("b >>>= 10 b >>>= 10 :" + Integer.toBinaryString(b >>> 10));
    }
}
